package com.wtf.dsp.admin.model;

import com.wtf.dsp.admin.enums.CommonErrorEnum;
import com.wtf.dsp.admin.exception.WtfDspException;
import com.wtf.dsp.admin.interceptor.AuthContextHolder;

/**
 * ClassName: LoginUserContext
 * Description:
 * date: 2024/9/11 18:30
 *
 * @author linhuanyou
 * @version 1.0
 */
public class LoginUserContext {
    public static LoginUser loginUser(){
        LoginUser loginUser = AuthContextHolder.getInstance().getContext();
        if(loginUser == null){
            throw new WtfDspException(CommonErrorEnum.ERROR_NOT_LOGIN);
        }
        return loginUser;
    }

}
